package com.ruoyi.distributionLog.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.distributionLog.mapper.DistributionLogMapper;
import com.ruoyi.distributionLog.domain.DistributionLog;
import com.ruoyi.distributionLog.service.IDistributionLogService;

/**
 * 分销操作日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-11
 */
@Service
public class DistributionLogServiceImpl implements IDistributionLogService 
{
    @Autowired
    private DistributionLogMapper distributionLogMapper;

    /**
     * 查询分销操作日志
     * 
     * @param logId 分销操作日志主键
     * @return 分销操作日志
     */
    @Override
    public DistributionLog selectDistributionLogByLogId(Long logId)
    {
        return distributionLogMapper.selectDistributionLogByLogId(logId);
    }

    /**
     * 查询分销操作日志列表
     * 
     * @param distributionLog 分销操作日志
     * @return 分销操作日志
     */
    @Override
    public List<DistributionLog> selectDistributionLogList(DistributionLog distributionLog)
    {
        return distributionLogMapper.selectDistributionLogList(distributionLog);
    }

    /**
     * 新增分销操作日志
     * 
     * @param distributionLog 分销操作日志
     * @return 结果
     */
    @Override
    public int insertDistributionLog(DistributionLog distributionLog)
    {
        distributionLog.setCreateTime(DateUtils.getNowDate());
        return distributionLogMapper.insertDistributionLog(distributionLog);
    }

    /**
     * 修改分销操作日志
     * 
     * @param distributionLog 分销操作日志
     * @return 结果
     */
    @Override
    public int updateDistributionLog(DistributionLog distributionLog)
    {
        distributionLog.setUpdateTime(DateUtils.getNowDate());
        return distributionLogMapper.updateDistributionLog(distributionLog);
    }

    /**
     * 批量删除分销操作日志
     * 
     * @param logIds 需要删除的分销操作日志主键
     * @return 结果
     */
    @Override
    public int deleteDistributionLogByLogIds(Long[] logIds)
    {
        return distributionLogMapper.deleteDistributionLogByLogIds(logIds);
    }

    /**
     * 删除分销操作日志信息
     * 
     * @param logId 分销操作日志主键
     * @return 结果
     */
    @Override
    public int deleteDistributionLogByLogId(Long logId)
    {
        return distributionLogMapper.deleteDistributionLogByLogId(logId);
    }
}
